<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script src="../jquery.min.js"></script>
        <script src="../封装自己的ajax/myAjax.js"></script>

        <script>
            $(function () {
                myAjax({
                    method: 'GET',
                    url: 'http://www.liulongbin.top:3006/api/getbooks',
                    success: function (res) {
                        console.log(res)
                    },
                })

                myAjax({
                    method: 'post',
                    url: 'http://www.liulongbin.top:3006/api/addbook',
                    data: { author: '小张', bookname: '三体', publisher: '安徽出版社' },
                    success: function (res) {
                        console.log(res)
                    },
                })
            })
        </script>
    </body>
</html>
